package cn.tedu.csmall.product.controller;

import cn.tedu.csmall.product.ex.ServiceException;
import cn.tedu.csmall.product.pojo.dto.AlbumAddNewDto;
import cn.tedu.csmall.product.service.IAlbumService;
import cn.tedu.csmall.product.web.JsonResult;
import cn.tedu.csmall.product.web.ServiceCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AlbumController {
    @Autowired
    private IAlbumService service;

    @RequestMapping("/album/add-new")
    public JsonResult addNew(AlbumAddNewDto albumAddNewDto){
            service.addNew(albumAddNewDto);
            return JsonResult.ok();
    }
    @RequestMapping("/album/delete")
    public JsonResult delete(Long id){
            service.delete(id);
            return JsonResult.ok();
    }

}
